package com.esserver.controller;

import com.esserver.common.po.ResponseBody;
import com.esserver.common.po.ResponseCode;
import com.esserver.mapper.AccountMapper;
import com.esserver.po.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class IndexController {

    @Autowired
    private AccountMapper accountMapper;

    @GetMapping("/findAccount")
    public ResponseBody findAccount() {
        List<Account> accounts = accountMapper.findList();
        System.out.println(accounts);
        System.out.println(accountMapper.selectAll());
        System.out.println(accountMapper.findAll());
        return ResponseBody.success(ResponseCode.OK.MSG, accounts);
    }
}